//
// Created by zain on 2017/3/14.
//

#ifndef PROJECT_SINGLEMESH_H
#define PROJECT_SINGLEMESH_H

#include "Object.h"
#include "Material.h"

namespace ZainGL {
#define BONES_NUM_PER_VTX 4

    struct Vertex {
        glm::vec3 Position;
        glm::vec3 Normal;
        glm::vec2 TexCoord;
        GLuint BoneIDs[BONES_NUM_PER_VTX];
        GLfloat BoneWeights[BONES_NUM_PER_VTX];
    };

    class EntityObject : public Object {
    public:
        GLuint mVAO;
        GLuint mIBO;

        Material *mMaterial;

        std::vector<Vertex> mVertices;
        std::vector<GLuint> mIndices;
        std::vector<Texture *> mTextures;

        virtual void
        draw(std::vector<glm::mat4> *const instanceTransforms= nullptr);

        virtual void renderToShadowMap(std::vector<glm::mat4> *const instanceTransforms = nullptr);

    };
}


#endif //PROJECT_SINGLEMESH_H
